#include "gd32l23x.h"
#include "stdint.h"
#include "DevicesPower.h"


void vPowerInit(void)
{
    /* enable the GPIO clock */
    rcu_periph_clock_enable(RCU_GPIOC);

    vPowerClose(POWER_CHANNEL_ALL);

    gpio_mode_set(POWER_DCDC_OUT_GPIO_Port, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, POWER_DCDC_OUT_Pin);
}

void vPowerOpen(uint16_t usNumber)
{
    if(usNumber & POWER_CHANNEL_DCDC_OUT)
    {
        POWER_DCDC_OUT_ENABLE();
    }
}

void vPowerClose(uint16_t usNumber)
{
    if(usNumber & POWER_CHANNEL_DCDC_OUT)
    {
        POWER_DCDC_OUT_DISABLE();
    }
}
